// ClipPropertiesDialog
// $Id: ClipPropertiesDialog.java,v 1.16 2003/07/20 06:46:16 axelwernicke Exp $
//
// Copyright (C) 2002-2003 Axel Wernicke <axel.wernicke@gmx.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

package de.axelwernicke.mypod.gui;

import java.awt.CardLayout;
import java.util.List;
import java.util.Vector;
import java.util.logging.Logger;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JTree;
import javax.swing.tree.TreePath;

import de.axelwernicke.mypod.DataPool;
import de.axelwernicke.mypod.MP3Meta;
import de.axelwernicke.mypod.util.LanguageUtils;


/**
 * Dialog to change clip properties (mostly id3 tags)
 * @author  axel wernicke
 */
public class ClipPropertiesDialog extends javax.swing.JDialog {
    /** jdk1.4 logger */
    private static Logger logger = Logger.getLogger("de.axelwernicke.mypod.gui");

    /** dialog was confirmed by user */
    private boolean confirmed = false;

    /** Creates new form MP3MetaPropertyDialog */
    public ClipPropertiesDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        getRootPane().setDefaultButton(OkButton);
    }

    /**
     * This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    private void initComponents() //GEN-BEGIN:initComponents
     {
        java.awt.GridBagConstraints gridBagConstraints;

        splitPane = new javax.swing.JSplitPane();
        treeScrollPane = new javax.swing.JScrollPane();
        optionTree = new javax.swing.JTree();
        contentPanel = new javax.swing.JPanel();
        trackScrollPane = new javax.swing.JScrollPane();
        trackPanel = new javax.swing.JPanel();
        tileLabel = new javax.swing.JLabel();
        titleComboBox = new javax.swing.JComboBox();
        trackLabel = new javax.swing.JLabel();
        trackComboBox = new javax.swing.JComboBox();
        artistLabel = new javax.swing.JLabel();
        artistComboBox = new javax.swing.JComboBox();
        composerLabel = new javax.swing.JLabel();
        composerComboBox = new javax.swing.JComboBox();
        lyricistLabel = new javax.swing.JLabel();
        lyricistComboBox = new javax.swing.JComboBox();
        bandLabel = new javax.swing.JLabel();
        bandComboBox = new javax.swing.JComboBox();
        playcounterLabel = new javax.swing.JLabel();
        playcounterComboBox = new javax.swing.JComboBox();
        languageLabel = new javax.swing.JLabel();
        languageComboBox = new javax.swing.JComboBox();
        bpmLabel = new javax.swing.JLabel();
        bpmComboBox = new javax.swing.JComboBox();
        commentLabel = new javax.swing.JLabel();
        commentComboBox = new javax.swing.JComboBox();
        encodedByLabel = new javax.swing.JLabel();
        encodedByComboBox = new javax.swing.JComboBox();
        dummyJLabel = new javax.swing.JLabel();
        albumScrollPane = new javax.swing.JScrollPane();
        albumPanel = new javax.swing.JPanel();
        albumLabel = new javax.swing.JLabel();
        albumComboBox = new javax.swing.JComboBox();
        yearLabel = new javax.swing.JLabel();
        yearComboBox = new javax.swing.JComboBox();
        genreLabel = new javax.swing.JLabel();
        genreComboBox = new javax.swing.JComboBox();
        contentGroupSetLabel = new javax.swing.JLabel();
        contentGroupSetComboBox = new javax.swing.JComboBox();
        cdIdentifierLabel = new javax.swing.JLabel();
        cdIdentifierComboBox = new javax.swing.JComboBox();
        isrcLabel = new javax.swing.JLabel();
        isrcComboBox = new javax.swing.JComboBox();
        dummyJLabel1 = new javax.swing.JLabel();
        creditsScrollPane = new javax.swing.JScrollPane();
        creditsPanel = new javax.swing.JPanel();
        publisherLabel = new javax.swing.JLabel();
        publisherComboBox = new javax.swing.JComboBox();
        publisherWebpageLabel = new javax.swing.JLabel();
        publisherWebpageComboBox = new javax.swing.JComboBox();
        copyrightTextLabel = new javax.swing.JLabel();
        copyrightTextComboBox = new javax.swing.JComboBox();
        copyrightWebpageLabel = new javax.swing.JLabel();
        copyrightWebpageComboBox = new javax.swing.JComboBox();
        dummyJLabel2 = new javax.swing.JLabel();
        originalCard = new javax.swing.JScrollPane();
        originalPanel = new javax.swing.JPanel();
        originalTitleLabel = new javax.swing.JLabel();
        originalTitleComboBox = new javax.swing.JComboBox();
        originalArtistLabel = new javax.swing.JLabel();
        originalArtistComboBox = new javax.swing.JComboBox();
        originalLyricistLabel = new javax.swing.JLabel();
        originalLyricistComboBox = new javax.swing.JComboBox();
        originalYearLabel = new javax.swing.JLabel();
        originalYearComboBox = new javax.swing.JComboBox();
        dummyJLabel3 = new javax.swing.JLabel();
        buttonPanel = new javax.swing.JPanel();
        OkButton = new javax.swing.JButton();
        CancelButton = new javax.swing.JButton();

        setTitle(GuiUtils.getStringLocalized("resource/language", "id3TagEditor"));
        setModal(true);
        setName("clipProperties");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                closeDialog(evt);
            }
        });

        splitPane.setDividerLocation(150);
        optionTree.setMinimumSize(new java.awt.Dimension(145, 72));
        optionTree.setPreferredSize(new java.awt.Dimension(145, 72));
        optionTree.setRootVisible(false);
        optionTree.setShowsRootHandles(true);
        optionTree.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                optionTreeMouseClicked(evt);
            }
        });
        optionTree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
            public void valueChanged(javax.swing.event.TreeSelectionEvent evt) {
                optionTreeValueChanged(evt);
            }
        });

        treeScrollPane.setViewportView(optionTree);

        splitPane.setLeftComponent(treeScrollPane);

        contentPanel.setLayout(new java.awt.CardLayout());

        contentPanel.setMaximumSize(new java.awt.Dimension(450, 400));
        contentPanel.setMinimumSize(new java.awt.Dimension(450, 375));
        contentPanel.setPreferredSize(new java.awt.Dimension(450, 375));
        trackScrollPane.setPreferredSize(new java.awt.Dimension(353, 203));
        trackPanel.setLayout(new java.awt.GridBagLayout());

        trackPanel.setMaximumSize(new java.awt.Dimension(2147483647, 2147483647));
        trackPanel.setMinimumSize(new java.awt.Dimension(263, 119));
        trackPanel.setName("trackPanel");
        trackPanel.setPreferredSize(new java.awt.Dimension(350, 200));
        tileLabel.setForeground(new java.awt.Color(102, 102, 153));
        tileLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        tileLabel.setText(GuiUtils.getStringLocalized("resource/language", "title:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 0);
        trackPanel.add(tileLabel, gridBagConstraints);

        titleComboBox.setEditable(true);
        titleComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(12, 11, 0, 12);
        trackPanel.add(titleComboBox, gridBagConstraints);

        trackLabel.setForeground(new java.awt.Color(102, 102, 153));
        trackLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        trackLabel.setText(GuiUtils.getStringLocalized("resource/language", "track:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        trackPanel.add(trackLabel, gridBagConstraints);

        trackComboBox.setEditable(true);
        trackComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 11, 0, 12);
        trackPanel.add(trackComboBox, gridBagConstraints);

        artistLabel.setForeground(new java.awt.Color(102, 102, 153));
        artistLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        artistLabel.setText(GuiUtils.getStringLocalized("resource/language", "artist:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(11, 12, 0, 0);
        trackPanel.add(artistLabel, gridBagConstraints);

        artistComboBox.setEditable(true);
        artistComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(11, 11, 0, 12);
        trackPanel.add(artistComboBox, gridBagConstraints);

        composerLabel.setForeground(new java.awt.Color(102, 102, 153));
        composerLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        composerLabel.setText(GuiUtils.getStringLocalized("resource/language", "composer:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        trackPanel.add(composerLabel, gridBagConstraints);

        composerComboBox.setEditable(true);
        composerComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 11, 0, 12);
        trackPanel.add(composerComboBox, gridBagConstraints);

        lyricistLabel.setForeground(new java.awt.Color(102, 102, 153));
        lyricistLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        lyricistLabel.setText(GuiUtils.getStringLocalized("resource/language", "lyricist:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        trackPanel.add(lyricistLabel, gridBagConstraints);

        lyricistComboBox.setEditable(true);
        lyricistComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 11, 0, 12);
        trackPanel.add(lyricistComboBox, gridBagConstraints);

        bandLabel.setForeground(new java.awt.Color(102, 102, 153));
        bandLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        bandLabel.setText(GuiUtils.getStringLocalized("resource/language", "band:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        trackPanel.add(bandLabel, gridBagConstraints);

        bandComboBox.setEditable(true);
        bandComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 11, 0, 12);
        trackPanel.add(bandComboBox, gridBagConstraints);

        playcounterLabel.setForeground(new java.awt.Color(102, 102, 153));
        playcounterLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        playcounterLabel.setText(GuiUtils.getStringLocalized("resource/language", "playcounter:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(11, 12, 0, 0);
        trackPanel.add(playcounterLabel, gridBagConstraints);

        playcounterComboBox.setEditable(true);
        playcounterComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(11, 11, 0, 12);
        trackPanel.add(playcounterComboBox, gridBagConstraints);

        languageLabel.setForeground(new java.awt.Color(102, 102, 153));
        languageLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        languageLabel.setText(GuiUtils.getStringLocalized("resource/language", "language:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        trackPanel.add(languageLabel, gridBagConstraints);

        languageComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        languageComboBox.setMinimumSize(new java.awt.Dimension(126, 23));
        languageComboBox.setPreferredSize(new java.awt.Dimension(126, 23));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 11, 0, 12);
        trackPanel.add(languageComboBox, gridBagConstraints);

        bpmLabel.setForeground(new java.awt.Color(102, 102, 153));
        bpmLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        bpmLabel.setText(GuiUtils.getStringLocalized("resource/language", "bpm:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 8;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        trackPanel.add(bpmLabel, gridBagConstraints);

        bpmComboBox.setEditable(true);
        bpmComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 8;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 11, 0, 12);
        trackPanel.add(bpmComboBox, gridBagConstraints);

        commentLabel.setForeground(new java.awt.Color(102, 102, 153));
        commentLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        commentLabel.setText(GuiUtils.getStringLocalized("resource/language", "comment:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 9;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(11, 12, 0, 0);
        trackPanel.add(commentLabel, gridBagConstraints);

        commentComboBox.setEditable(true);
        commentComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 9;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(11, 11, 0, 12);
        trackPanel.add(commentComboBox, gridBagConstraints);

        encodedByLabel.setForeground(new java.awt.Color(102, 102, 153));
        encodedByLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        encodedByLabel.setText(GuiUtils.getStringLocalized("resource/language", "encodedBy:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 10;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 12, 0);
        trackPanel.add(encodedByLabel, gridBagConstraints);

        encodedByComboBox.setEditable(true);
        encodedByComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 10;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 11, 12, 12);
        trackPanel.add(encodedByComboBox, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 11;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.weighty = 0.1;
        trackPanel.add(dummyJLabel, gridBagConstraints);

        trackScrollPane.setViewportView(trackPanel);

        contentPanel.add(trackScrollPane, "trackCard");

        albumScrollPane.setPreferredSize(new java.awt.Dimension(353, 203));
        albumPanel.setLayout(new java.awt.GridBagLayout());

        albumPanel.setMinimumSize(new java.awt.Dimension(263, 119));
        albumPanel.setName("albumPanel");
        albumPanel.setPreferredSize(new java.awt.Dimension(350, 200));
        albumLabel.setForeground(new java.awt.Color(102, 102, 153));
        albumLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        albumLabel.setText(GuiUtils.getStringLocalized("resource/language", "album:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 0);
        albumPanel.add(albumLabel, gridBagConstraints);

        albumComboBox.setEditable(true);
        albumComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        albumComboBox.setMaximumSize(new java.awt.Dimension(350, 32767));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(12, 11, 0, 12);
        albumPanel.add(albumComboBox, gridBagConstraints);

        yearLabel.setForeground(new java.awt.Color(102, 102, 153));
        yearLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        yearLabel.setText(GuiUtils.getStringLocalized("resource/language", "year:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        albumPanel.add(yearLabel, gridBagConstraints);

        yearComboBox.setEditable(true);
        yearComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        yearComboBox.setPreferredSize(new java.awt.Dimension(100, 23));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 11, 0, 12);
        albumPanel.add(yearComboBox, gridBagConstraints);

        genreLabel.setForeground(new java.awt.Color(102, 102, 153));
        genreLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        genreLabel.setText(GuiUtils.getStringLocalized("resource/language", "genre:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(11, 12, 0, 0);
        albumPanel.add(genreLabel, gridBagConstraints);

        genreComboBox.setEditable(true);
        genreComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        genreComboBox.setMaximumSize(new java.awt.Dimension(350, 32767));
        genreComboBox.setPreferredSize(new java.awt.Dimension(50, 23));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(11, 11, 0, 12);
        albumPanel.add(genreComboBox, gridBagConstraints);

        contentGroupSetLabel.setForeground(new java.awt.Color(102, 102, 153));
        contentGroupSetLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        contentGroupSetLabel.setText(GuiUtils.getStringLocalized("resource/language", "contentGroupSet:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        albumPanel.add(contentGroupSetLabel, gridBagConstraints);

        contentGroupSetComboBox.setEditable(true);
        contentGroupSetComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        contentGroupSetComboBox.setMaximumSize(new java.awt.Dimension(350, 32767));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 11, 0, 12);
        albumPanel.add(contentGroupSetComboBox, gridBagConstraints);

        cdIdentifierLabel.setForeground(new java.awt.Color(102, 102, 153));
        cdIdentifierLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        cdIdentifierLabel.setText(GuiUtils.getStringLocalized("resource/language", "cdIdentifier:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(11, 12, 0, 0);
        albumPanel.add(cdIdentifierLabel, gridBagConstraints);

        cdIdentifierComboBox.setEditable(true);
        cdIdentifierComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        cdIdentifierComboBox.setMaximumSize(new java.awt.Dimension(350, 32767));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(11, 11, 0, 12);
        albumPanel.add(cdIdentifierComboBox, gridBagConstraints);

        isrcLabel.setForeground(new java.awt.Color(102, 102, 153));
        isrcLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        isrcLabel.setText(GuiUtils.getStringLocalized("resource/language", "isrc:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        albumPanel.add(isrcLabel, gridBagConstraints);

        isrcComboBox.setEditable(true);
        isrcComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        isrcComboBox.setMaximumSize(new java.awt.Dimension(350, 32767));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 11, 0, 12);
        albumPanel.add(isrcComboBox, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 9;
        gridBagConstraints.weighty = 0.1;
        albumPanel.add(dummyJLabel1, gridBagConstraints);

        albumScrollPane.setViewportView(albumPanel);

        contentPanel.add(albumScrollPane, "albumCard");

        creditsPanel.setLayout(new java.awt.GridBagLayout());

        creditsPanel.setMinimumSize(new java.awt.Dimension(263, 119));
        creditsPanel.setName("creditsPanel");
        creditsPanel.setPreferredSize(new java.awt.Dimension(350, 200));
        publisherLabel.setForeground(new java.awt.Color(102, 102, 153));
        publisherLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        publisherLabel.setText(GuiUtils.getStringLocalized("resource/language", "publisher:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 0);
        creditsPanel.add(publisherLabel, gridBagConstraints);

        publisherComboBox.setEditable(true);
        publisherComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(12, 11, 0, 12);
        creditsPanel.add(publisherComboBox, gridBagConstraints);

        publisherWebpageLabel.setForeground(new java.awt.Color(102, 102, 153));
        publisherWebpageLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        publisherWebpageLabel.setText(GuiUtils.getStringLocalized("resource/language", "publisherWebpage:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        creditsPanel.add(publisherWebpageLabel, gridBagConstraints);

        publisherWebpageComboBox.setEditable(true);
        publisherWebpageComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 11, 0, 12);
        creditsPanel.add(publisherWebpageComboBox, gridBagConstraints);

        copyrightTextLabel.setForeground(new java.awt.Color(102, 102, 153));
        copyrightTextLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        copyrightTextLabel.setText(GuiUtils.getStringLocalized("resource/language", "copyrightText:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(11, 12, 0, 0);
        creditsPanel.add(copyrightTextLabel, gridBagConstraints);

        copyrightTextComboBox.setEditable(true);
        copyrightTextComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(11, 11, 0, 12);
        creditsPanel.add(copyrightTextComboBox, gridBagConstraints);

        copyrightWebpageLabel.setForeground(new java.awt.Color(102, 102, 153));
        copyrightWebpageLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        copyrightWebpageLabel.setText(GuiUtils.getStringLocalized("resource/language", "copyrightWebpage:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        creditsPanel.add(copyrightWebpageLabel, gridBagConstraints);

        copyrightWebpageComboBox.setEditable(true);
        copyrightWebpageComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 11, 0, 12);
        creditsPanel.add(copyrightWebpageComboBox, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 9;
        gridBagConstraints.weighty = 0.1;
        creditsPanel.add(dummyJLabel2, gridBagConstraints);

        creditsScrollPane.setViewportView(creditsPanel);

        contentPanel.add(creditsScrollPane, "creditsCard");

        originalPanel.setLayout(new java.awt.GridBagLayout());

        originalPanel.setName("originalPanel");
        originalPanel.setPreferredSize(new java.awt.Dimension(350, 200));
        originalTitleLabel.setForeground(new java.awt.Color(102, 102, 153));
        originalTitleLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        originalTitleLabel.setText(GuiUtils.getStringLocalized("resource/language", "originalTitle:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 0);
        originalPanel.add(originalTitleLabel, gridBagConstraints);

        originalTitleComboBox.setEditable(true);
        originalTitleComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(12, 11, 0, 12);
        originalPanel.add(originalTitleComboBox, gridBagConstraints);

        originalArtistLabel.setForeground(new java.awt.Color(102, 102, 153));
        originalArtistLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        originalArtistLabel.setText(GuiUtils.getStringLocalized("resource/language", "originalArtist:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        originalPanel.add(originalArtistLabel, gridBagConstraints);

        originalArtistComboBox.setEditable(true);
        originalArtistComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 11, 0, 12);
        originalPanel.add(originalArtistComboBox, gridBagConstraints);

        originalLyricistLabel.setForeground(new java.awt.Color(102, 102, 153));
        originalLyricistLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        originalLyricistLabel.setText(GuiUtils.getStringLocalized("resource/language", "originalLyricist:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        originalPanel.add(originalLyricistLabel, gridBagConstraints);

        originalLyricistComboBox.setEditable(true);
        originalLyricistComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 11, 0, 12);
        originalPanel.add(originalLyricistComboBox, gridBagConstraints);

        originalYearLabel.setForeground(new java.awt.Color(102, 102, 153));
        originalYearLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        originalYearLabel.setText(GuiUtils.getStringLocalized("resource/language", "originalYear:"));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.ipadx = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
        originalPanel.add(originalYearLabel, gridBagConstraints);

        originalYearComboBox.setEditable(true);
        originalYearComboBox.setFont(new java.awt.Font("Dialog", 1, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 11, 0, 12);
        originalPanel.add(originalYearComboBox, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 9;
        gridBagConstraints.weighty = 0.1;
        originalPanel.add(dummyJLabel3, gridBagConstraints);

        originalCard.setViewportView(originalPanel);

        contentPanel.add(originalCard, "originalCard");

        splitPane.setRightComponent(contentPanel);

        getContentPane().add(splitPane, java.awt.BorderLayout.CENTER);

        OkButton.setText(GuiUtils.getStringLocalized("resource/language", "ok"));
        OkButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    OkButtonActionPerformed(evt);
                }
            });

        buttonPanel.add(OkButton);

        CancelButton.setText(GuiUtils.getStringLocalized("resource/language", "cancel"));
        CancelButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    CancelButtonActionPerformed(evt);
                }
            });

        buttonPanel.add(CancelButton);

        getContentPane().add(buttonPanel, java.awt.BorderLayout.SOUTH);

        pack();
    } //GEN-END:initComponents

    private void optionTreeValueChanged(javax.swing.event.TreeSelectionEvent evt) //GEN-FIRST:event_optionTreeValueChanged
     { //GEN-HEADEREND:event_optionTreeValueChanged
        // get selected leaf
        try {
            TreePath tpath = evt.getNewLeadSelectionPath();
            String leaf = tpath.getLastPathComponent().toString();

            // show card selected
            showCard(leaf);
        } catch (Exception e) {
            logger.warning("Exception raised:" + e.getMessage());
            e.printStackTrace();
        }
    } //GEN-LAST:event_optionTreeValueChanged

    private void optionTreeMouseClicked(java.awt.event.MouseEvent evt) //GEN-FIRST:event_optionTreeMouseClicked
     { //GEN-HEADEREND:event_optionTreeMouseClicked
        // determine which object was clicked
        try {
            JTree jtree = (JTree) evt.getSource();
            String leaf = jtree.getSelectionPath().getLastPathComponent().toString();

            // show card selected
            showCard(leaf);
        } catch (Exception e) {
            logger.warning("Exception raised:" + e.getMessage());
            e.printStackTrace();
        }
    } //GEN-LAST:event_optionTreeMouseClicked

    private void OkButtonActionPerformed(java.awt.event.ActionEvent evt) //GEN-FIRST:event_OkButtonActionPerformed
     { //GEN-HEADEREND:event_OkButtonActionPerformed
        confirmed = true;
        setVisible(false);
    } //GEN-LAST:event_OkButtonActionPerformed

    private void CancelButtonActionPerformed(java.awt.event.ActionEvent evt) //GEN-FIRST:event_CancelButtonActionPerformed
     { //GEN-HEADEREND:event_CancelButtonActionPerformed
        confirmed = false;
        setVisible(false);
    } //GEN-LAST:event_CancelButtonActionPerformed

    /** Closes the dialog */
    private void closeDialog(java.awt.event.WindowEvent evt) { //GEN-FIRST:event_closeDialog
        confirmed = false;
        setVisible(false);
    } //GEN-LAST:event_closeDialog

    /** Getter for property confirmed.
     * @return Value of property confirmed.
     *
     */
    public boolean isConfirmed() {
        return confirmed;
    }

    /** Setter for property confirmed.
     * @param confirmed New value of property confirmed.
     *
     */
    public void setConfirmed(boolean confirmed) {
        this.confirmed = confirmed;
    }

    /** Activates a card by name
     */
    private void showCard(String name) {
        // set property card
        CardLayout cardLayout = (CardLayout) contentPanel.getLayout();

        if (name.equals(GuiUtils.getStringLocalized("resource/language", "track"))) {
            contentPanel.repaint();
            cardLayout.show(this.contentPanel, "trackCard");
        } else if (name.equals(GuiUtils.getStringLocalized("resource/language", "album"))) {
            contentPanel.repaint();
            cardLayout.show(this.contentPanel, "albumCard");
        } else if (name.equals(GuiUtils.getStringLocalized("resource/language", "credits"))) {
            contentPanel.repaint();
            cardLayout.show(this.contentPanel, "creditsCard");
        } else if (name.equals(GuiUtils.getStringLocalized("resource/language", "original"))) {
            contentPanel.repaint();
            cardLayout.show(this.contentPanel, "originalCard");
        }
    }

    /**
     * Gets the values changed by the user as mp3meta object.
     * @return mp3 meta data object containing only changed values. Other values are null or -1
     */
    MP3Meta getChangedValues() {
        MP3Meta meta = new MP3Meta();
        String dummyValue = GuiUtils.getStringLocalized("leaveAsIs");

        /* ----------------- STRING VALUES -------------------------- */
        meta.set("Album", prepareStringValue(dummyValue, this.albumComboBox.getSelectedItem()));
        meta.set("Artist", prepareStringValue(dummyValue, this.artistComboBox.getSelectedItem()));
        meta.set("Band", prepareStringValue(dummyValue, this.bandComboBox.getSelectedItem()));
        meta.set("BPM", prepareStringValue(dummyValue, this.bpmComboBox.getSelectedItem()));
        meta.set("CDIdentifier", prepareStringValue(dummyValue, this.cdIdentifierComboBox.getSelectedItem()));
        meta.set("Comment", prepareStringValue(dummyValue, this.commentComboBox.getSelectedItem()));
        meta.set("Composer", prepareStringValue(dummyValue, this.composerComboBox.getSelectedItem()));
        meta.set("ContentGroupset", prepareStringValue(dummyValue, this.contentGroupSetComboBox.getSelectedItem()));
        meta.set("CopyrightText", prepareStringValue(dummyValue, this.copyrightTextComboBox.getSelectedItem()));
        meta.set("CopyrightWebpage", prepareStringValue(dummyValue, this.copyrightWebpageComboBox.getSelectedItem()));
        meta.set("EncodedBy", prepareStringValue(dummyValue, this.encodedByComboBox.getSelectedItem()));
        meta.set("Genre", prepareStringValue(dummyValue, this.genreComboBox.getSelectedItem()));
        meta.set("ISRC", prepareStringValue(dummyValue, this.isrcComboBox.getSelectedItem()));
        meta.set("Language", prepareStringValue(dummyValue, this.languageComboBox.getSelectedItem()));
        meta.set("Lyricist", prepareStringValue(dummyValue, this.lyricistComboBox.getSelectedItem()));
        meta.set("OriginalArtist", prepareStringValue(dummyValue, this.originalArtistComboBox.getSelectedItem()));
        meta.set("OriginalLyricist", prepareStringValue(dummyValue, this.originalLyricistComboBox.getSelectedItem()));
        meta.set("OriginalTitle", prepareStringValue(dummyValue, this.originalTitleComboBox.getSelectedItem()));
        meta.set("OriginalYear", prepareStringValue(dummyValue, this.originalYearComboBox.getSelectedItem()));
        meta.set("PlayCounter", prepareStringValue(dummyValue, this.playcounterComboBox.getSelectedItem()));
        meta.set("Publisher", prepareStringValue(dummyValue, this.publisherComboBox.getSelectedItem()));
        meta.set("PublishersWebpage", prepareStringValue(dummyValue, this.publisherWebpageComboBox.getSelectedItem()));
        meta.set("Title", prepareStringValue(dummyValue, this.titleComboBox.getSelectedItem()));
        meta.set("Publisher", prepareStringValue(dummyValue, this.publisherComboBox.getSelectedItem()));

        /* ----------------------------------- NUMERIC VALUES ----------------------- */
        meta.set("Track", prepareIntValue(dummyValue, this.trackComboBox.getSelectedItem()));
        meta.set("Year", prepareIntValue(dummyValue, this.yearComboBox.getSelectedItem()));

        // return meta data from clips properties dialog
        return meta;
    }

    /** Prepares the selected item in the dialog to be an string in the meta object of changed values.
     * @param dummyValue value to be explicitly not set in the result
     * @param value to prepare
     * @return prepared value
     */
    private String prepareStringValue(String dummyValue, Object value) {
        return ((value != null) && !value.toString().equals(dummyValue)) ? value.toString() : null;
    }

    /** Prepares the selected item in the dialog to be an int in the meta object of changed values.
     * @param dummyValue value to be explicitly not set in the result
     * @param value to prepare
     * @return prepared value
     */
    private int prepareIntValue(String dummyValue, Object value) {
        int iValue = -1;
        try {
            if ((value != null) && !value.toString().equals(dummyValue)) {
                iValue = (value instanceof Integer) ? ((Integer) value).intValue() : Integer.valueOf((String) value).intValue();
            }
        } catch (Exception e) {
            logger.warning("Exception raised : " + e.getMessage());
        }

        return iValue;
    }

    /** Sets the values in a clip properties dialog
     *
     * @param dataPool to get lists
     * @param clips to read values from
     */
    void setValues(DataPool dataPool, List<Long> clips) {
        String defaultValue = GuiUtils.getStringLocalized("leaveAsIs");

        /* ------------------------- STRING VALUES -------------------- */
        this.albumComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("Album", clips, true)));
        this.artistComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("Artist", clips, true)));
        this.bpmComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("Bpm", clips, true)));
        this.bandComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("Band", clips, true)));
        this.cdIdentifierComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("CdIdentifier", clips, true)));
        this.commentComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("Comment", clips, true)));
        this.composerComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("Composer", clips, true)));
        this.contentGroupSetComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("ContentGroupSet", clips, true)));
        this.copyrightTextComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("CopyrightText", clips, true)));
        this.copyrightWebpageComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("CopyrightWebpage", clips, true)));
        this.encodedByComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("EncodedBy", clips, true)));
        this.genreComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("Genre", clips, true)));
        this.isrcComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("Isrc", clips, true)));
        this.languageComboBox.setModel(prepareComboBoxModel(defaultValue, LanguageUtils.getAllLanguageNames()));
        this.lyricistComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("Lyricist", clips, true)));
        this.originalArtistComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("OriginalArtist", clips, true)));
        this.originalTitleComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("OriginalTitle", clips, true)));
        this.originalLyricistComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("OriginalLyricist", clips, true)));
        this.originalYearComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("OriginalYear", clips, true)));
        this.playcounterComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("Playcounter", clips, true)));
        this.publisherComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("Publisher", clips, true)));
        this.publisherWebpageComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("PublisherWebpage", clips, true)));
        this.titleComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("Title", clips, true)));

        /* ------------------------- STRING VALUES -------------------- */
        this.trackComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("Track", clips, true)));
        this.yearComboBox.setModel(prepareComboBoxModel(defaultValue, dataPool.getAllValues("Year", clips, true)));
    }

    /**
     */
    private DefaultComboBoxModel prepareComboBoxModel(String defaultValue, List<String> values) {
        values.add(0, defaultValue);
        return new DefaultComboBoxModel(new Vector<String>(values));
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton CancelButton;
    private javax.swing.JButton OkButton;
    public javax.swing.JComboBox albumComboBox;
    private javax.swing.JLabel albumLabel;
    private javax.swing.JPanel albumPanel;
    private javax.swing.JScrollPane albumScrollPane;
    public javax.swing.JComboBox artistComboBox;
    private javax.swing.JLabel artistLabel;
    public javax.swing.JComboBox bandComboBox;
    private javax.swing.JLabel bandLabel;
    public javax.swing.JComboBox bpmComboBox;
    private javax.swing.JLabel bpmLabel;
    private javax.swing.JPanel buttonPanel;
    public javax.swing.JComboBox cdIdentifierComboBox;
    private javax.swing.JLabel cdIdentifierLabel;
    public javax.swing.JComboBox commentComboBox;
    private javax.swing.JLabel commentLabel;
    public javax.swing.JComboBox composerComboBox;
    private javax.swing.JLabel composerLabel;
    public javax.swing.JComboBox contentGroupSetComboBox;
    private javax.swing.JLabel contentGroupSetLabel;
    private javax.swing.JPanel contentPanel;
    public javax.swing.JComboBox copyrightTextComboBox;
    private javax.swing.JLabel copyrightTextLabel;
    public javax.swing.JComboBox copyrightWebpageComboBox;
    private javax.swing.JLabel copyrightWebpageLabel;
    private javax.swing.JPanel creditsPanel;
    private javax.swing.JScrollPane creditsScrollPane;
    private javax.swing.JLabel dummyJLabel;
    private javax.swing.JLabel dummyJLabel1;
    private javax.swing.JLabel dummyJLabel2;
    private javax.swing.JLabel dummyJLabel3;
    public javax.swing.JComboBox encodedByComboBox;
    private javax.swing.JLabel encodedByLabel;
    public javax.swing.JComboBox genreComboBox;
    private javax.swing.JLabel genreLabel;
    public javax.swing.JComboBox isrcComboBox;
    private javax.swing.JLabel isrcLabel;
    public javax.swing.JComboBox languageComboBox;
    private javax.swing.JLabel languageLabel;
    public javax.swing.JComboBox lyricistComboBox;
    private javax.swing.JLabel lyricistLabel;
    public javax.swing.JTree optionTree;
    public javax.swing.JComboBox originalArtistComboBox;
    private javax.swing.JLabel originalArtistLabel;
    private javax.swing.JScrollPane originalCard;
    public javax.swing.JComboBox originalLyricistComboBox;
    private javax.swing.JLabel originalLyricistLabel;
    private javax.swing.JPanel originalPanel;
    public javax.swing.JComboBox originalTitleComboBox;
    private javax.swing.JLabel originalTitleLabel;
    public javax.swing.JComboBox originalYearComboBox;
    private javax.swing.JLabel originalYearLabel;
    public javax.swing.JComboBox playcounterComboBox;
    private javax.swing.JLabel playcounterLabel;
    public javax.swing.JComboBox publisherComboBox;
    private javax.swing.JLabel publisherLabel;
    public javax.swing.JComboBox publisherWebpageComboBox;
    private javax.swing.JLabel publisherWebpageLabel;
    private javax.swing.JSplitPane splitPane;
    private javax.swing.JLabel tileLabel;
    public javax.swing.JComboBox titleComboBox;
    public javax.swing.JComboBox trackComboBox;
    private javax.swing.JLabel trackLabel;
    private javax.swing.JPanel trackPanel;
    private javax.swing.JScrollPane trackScrollPane;
    private javax.swing.JScrollPane treeScrollPane;
    public javax.swing.JComboBox yearComboBox;
    private javax.swing.JLabel yearLabel;

    // End of variables declaration//GEN-END:variables
}
